package org.codeart.map.controller;

import org.codeart.common.request.PointRequest;
import org.codeart.common.util.R;
import org.codeart.map.service.PointService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/point")
public class PointController {

    @Autowired
    private PointService pointService;

    @PostMapping("/upload")
    public R<Void> upload(@RequestBody PointRequest pointRequest) {
        boolean b = pointService.upload(pointRequest);
        if (b) {
            return R.ok();
        }
        return R.fail("轨迹点上传失败");
    }

}
